package com.twu.biblioteca.model;

public class ItemStatus {
    private Item item;
    private Boolean isAvailable;

    public ItemStatus(Item item, Boolean isAvailable) {
        this.item = item;
        this.isAvailable = isAvailable;
    }

    public Item getItem() {
        return item;
    }

    public void setItem(Item item) {
        this.item = item;
    }

    public Boolean getIsAvailable() {
        return isAvailable;
    }

    public void setIsAvailable(Boolean isAvailable) {
        this.isAvailable = isAvailable;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ItemStatus that = (ItemStatus) o;

        if (item != null ? !item.equals(that.item) : that.item != null) return false;
        if (isAvailable != null ? !isAvailable.equals(that.isAvailable) : that.isAvailable != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = item != null ? item.hashCode() : 0;
        result = 31 * result + (isAvailable != null ? isAvailable.hashCode() : 0);
        return result;
    }
}
